package com.ruoyi.project.cms.pm.service.impl;

import com.ruoyi.project.cms.pm.domain.Process;
import com.ruoyi.project.cms.pm.domain.Project;
import com.ruoyi.project.cms.pm.mapper.ProcessMapper;
import com.ruoyi.project.cms.pm.mapper.ProjectMapper;
import com.ruoyi.project.cms.pm.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Joseph Wang
 * @version 1.0
 * @date 18/05/2020 12:16
 */
@Service
public class ProjectServiceImpl implements ProjectService {
    @Autowired
    private ProjectMapper projectMapper;
    @Autowired
    private ProcessMapper processMapper;

    @Override
    public List<Project> findProjectList(Project project) {
        return projectMapper.selectProjectList(project);
    }

    @Override
    public Project findProjectById(String pid) {
        return projectMapper.selectProjectById(pid);
    }

    @Override
    public List<Project> findUnassignedProject(Project project) {
        return projectMapper.selectUnassignedProjectList(project);
    }

    @Override
    public int insertAssignment(Process process) {
        return processMapper.insertProcess(process);
    }
}
